package main

import (
	"HomeMaterialManagementSystem/db"
	"HomeMaterialManagementSystem/web"
	"log"
	"os"
	"os/signal"
	"syscall"
)

func main() {

	// 初始化数据库
	db.InitDB()
	service := web.WebService{}
	service.Start()
	log.Println("服务启动")

	// 等待退出
	quit := make(chan os.Signal, 1)
	signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
	<-quit
	log.Println("停止……")
	service.Stop()
	log.Println("完成")
}
